#include "startmenu.h"
#include <QVBoxLayout>
#include <QLabel>
#include <QApplication>




StartMenu::~StartMenu() {
    // 清理资源（若有）
}
StartMenu::StartMenu(QWidget *parent) : QWidget(parent) {
    QVBoxLayout *layout = new QVBoxLayout(this);

    QLabel *title = new QLabel("飞机大战", this);
    title->setAlignment(Qt::AlignCenter);
    title->setStyleSheet("font: bold 36px; color: #FF5722;");

    startButton = new QPushButton("开始游戏", this);
    exitButton = new QPushButton("退出游戏", this);

    connect(startButton, &QPushButton::clicked, this, &StartMenu::gameStarted);
    connect(exitButton, &QPushButton::clicked, QApplication::instance(), &QApplication::quit);

    layout->addStretch();
    layout->addWidget(title);
    layout->addSpacing(40);
    layout->addWidget(startButton);
    layout->addSpacing(20);
    layout->addWidget(exitButton);
    layout->addStretch();

    setFixedSize(400, 300);
}
